﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Smith.ImageConverter
{
    public class WidthResize : BaseResize, IResize
    {
        public WidthResize(int width)
        {
            NewWidth = width;
        }

        protected override Size GetNewSize(int width, int height)
        {
            return new Size(
                NewWidth, 
                Convert.ToInt32((float)height * (float)NewWidth / (float)width));
        }

        public int NewWidth { get; private set; }
    }
}
